<template>
    <div class="container">
      <template>
        <div style="margin:30px">
          <el-input prefix-icon="el-icon-search" v-model="input" placeholder="请输入内容" style="width:200px"></el-input>&nbsp;
          <el-button type="success" @click="dialogFormVisible = true" icon="el-icon-search" circle></el-button>
          <el-button type="warning" icon="el-icon-zoom-in" @click="dialogFormVisible = true" style="margin-left:20px">高级查找
          </el-button>
        </div>
        <el-button type="primary" class="btn" @click="dialogFormVisible = true"
          icon="el-icon-circle-plus-outline">供应商</el-button>
        <el-button type="danger" class="btn" @click="open" icon="el-icon-remove-outline">批量删除</el-button>
        <el-dialog title="添加供应商" :visible.sync="dialogFormVisible">
          <el-form :model="form">
            <el-form-item label="客户名" :label-width="formLabelWidth">
              <el-input v-model="form.username" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="编码" :label-width="formLabelWidth">
              <el-input v-model="form.encode" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="负责人姓名" :label-width="formLabelWidth">
              <el-input v-model="form.encode" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="电话号码" :label-width="formLabelWidth">
              <el-input v-model="form.encode" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="供应商类别" :label-width="formLabelWidth">
              <el-input v-model="form.encode" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible = false">取消</el-button>
            <el-button type="primary" @click="dialogFormVisible = false; add()">添加</el-button>
          </div>
        </el-dialog>
        <div class="formContainer">
          <el-table :data="tableData" border style="width: 100%" max-height="460" :header-cell-style="{ textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
            <el-table-column type="selection" width="40"></el-table-column>
            <el-table-column prop="id" label="客户id" width="70">
            </el-table-column>
            <el-table-column prop="customername" label="客户名" width="150">
            </el-table-column>
            <el-table-column prop="encode" label="编码" width="150">
            </el-table-column>
            <el-table-column prop="name" label="联系人" width="140">
            </el-table-column>
            <el-table-column prop="phonenumber" label="联系电话" width="150">
            </el-table-column>
            <el-table-column prop="suppliergroup" label="联系地址" width="110">
            </el-table-column>
            <el-table-column prop="addtime" label="修改时间" width="150">
            </el-table-column>
            <el-table-column prop="suppliergroup" label="备注" width="90">
            </el-table-column>
            <el-table-column label="操作" width="90" fixed="right">
              <template slot-scope="scope">
                <el-button type="primary" icon="el-icon-edit" size="mini" circle></el-button>
              <el-button type="danger" icon="el-icon-delete" circle size="mini"></el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination align="center" style="margin: 8px" @size-change="handleSizeChange"
            @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 40]"
            :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="all">
          </el-pagination>
        </div>
      </template>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        formLabelWidth: '120px',
        dialogFormVisible: false,
        form: {
          username: '111',
          password: '111',
          code: '111',
          id: '111',
          encode: '',
          supplier: ''
        }, tableData: [{
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, , {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, , {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }, , {
          id: '1',
          suppliername: '王小虎',
          encode: '123567',
          group: '1',
          name: '2002',
          phonenumber: '23311341',
          suppliergroup: '12',
          addtime: '20020217'
        }]
      }
    }
  }
  </script>
  
  <style lang="less" scoped>
  .formContainer {
    padding: 5px 20px;
  }
  </style>